<html>
<head>
  <title>系统管理——商务信息</title>
  <meta name="layout" content="common_header"/>
  <link rel="stylesheet" type="text/css" href="${resource(dir: 'css', file: 'jquery.validate.css', absolute: true)}"/>
  <link rel="stylesheet" type="text/css" href="${resource(dir: 'css', file: 'autocomplete.css', absolute: true)}"/>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'jquery.metadata.pack.js', absolute: true)}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'jquery.validate.min.js', absolute: true)}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'jquery.form.min.js', absolute: true)}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'jquery.blockUI.min.js', absolute: true)}"></script>

  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'jquery.validate.custom.js', absolute: true)}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/prototype', file: 'prototype-1.4.0.js')}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/prototype', file: 'autocomplete.js')}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'autocomplete.custom.js')}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'common.custom.js', absolute: true)}"></script>
  <script type="text/javascript">
    jQuery(document).ready(function() {
      //bindSave();
      new CAPXOUS.AutoComplete("sector_NAME", function() {
        var dicName = "CIRCLE"
        var parent = jQuery("#area").val();
        return "${createLink(controller:'dictionary',action:'showList',absolute:true)}?dicName=" + dicName + "&parent=" + parent + "&t=" + (+new Date)
      }, {
        formName:'submitForm',
        formTarget:['sector'],
        javaTarget:['dm'],
        javaSource:['mc'],
        width:160
      });

      new CAPXOUS.AutoComplete("estate.name", function() {
        var sector = jQuery("#sector").val();
        return "${createLink(controller:'dictionary',action:'showAllEstateList',absolute:true)}?estateType=20&sector=" + sector + "&t=" + (+new Date)
      }, {
        formName:'submitForm',
        formTarget:['estate.id'],
        javaTarget:['dm'],
        javaSource:['mc'],
        width:160
      });

      new CAPXOUS.AutoComplete("user.company.estate.name", function() {
        //var sector=jQuery("#sector").val();
        var sector = '';
        return "${createLink(controller:'dictionary',action:'showAllEstateList',absolute:true)}?estateType=20&sector=" + sector + "&t=" + (+new Date)
      }, {
        formName:'companyForm',
        formTarget:['user.company.estate.id'],
        javaTarget:['dm'],
        javaSource:['mc'],
        width:160
      });
    })

    function selectEstate(v) {
      alert(v)

    }

    function saveForm(form) {
      if (!jQuery("#" + form).valid()) {
        jQuery(".error:first").select();
        return false;
      }
      jQuery("#" + form).ajaxSubmit({
        success: function(response) {
          if (response == "1") {
            alert("修改成功")
          } else {
            alert("修改出错")
          }
        }
      });
    }
  </script>
</head>
<body>
<div id="man_zone">
  <form id="submitForm" name="submitForm" action="${createLink(controller: "user", action: 'saveBusinessInfo', absolute: true)}" method="post">
    <input type="hidden" name="userid" value="${user?.id}"/>
    <input type="hidden" name="id" value="${bo?.id}"/>
    <table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" class="table_style">
      <tr>
        <td align="center" colspan="4" class="center_title_1">
          <b>商务信息</b>
        </td>
      </tr>
      <tr>
        <td width="20%" class="left_title_1">所在区域</td>
        <td width="30%" class="fillin">
          <input type="text" id="area_NAME" name="area_NAME" value="${bo?.areaName}" dicName="SH_DISTRICT" class="input_dict {notEmpty:'板块/商圈'}" tips="请选择地区"/>
          <input type="hidden" id="area" name="area" value="${bo?.area}"/>
        </td>
        <td width="20%" class="left_title_1">所在商圈/板块</td>
        <td width="30%" class="fillin">
          <input type="text" id="sector_NAME" name="sector_NAME" value="${bo?.sectorName}" class="input_dict {notEmpty:'板块/商圈'}" tips="请选择板块"/>
          <input type="hidden" id="sector" name="sector" value="${bo?.sector}"/>
        </td>
      </tr>
      <tr>
        <td width="20%" class="left_title_1">擅长物业类型</td>
        <td width="30%" class="fillin">
          <input type="text" id="propertyType" name="propertyType" value="${bo?.propertyType}"/>
        </td>
        <td width="20%" class="left_title_1">擅长服务类型</td>
        <td width="30%" class="fillin">
          <input type="text" id="serviceType" name="serviceType" value="${bo?.serviceType}"/>
        </td>
      </tr>
      <tr>
        <td width="20%" class="left_title_1">擅长楼盘名称</td>
        <td width="30%" class="fillin">
          <input type="text" id="estate.name" name="estate.name" value="${bo?.estate?.name}" class="input_dict {notEmpty:'板块/商圈'}" tips="请选择楼盘"/>
          <input type="hidden" id="estate.id" name="estate.id" value="${bo?.estate?.id}"/>
        </td>
        <td width="20%" class="left_title_1">主要服务语言</td>
        <td width="30%" class="fillin">
          <input type="text" id="language_NAME" name="language_NAME" value="${bo?.areaName}" dicName="LANGUAGE" class="input_dict {notEmpty:'语言'}" tips="请选择语言"/>
          <input type="hidden" id="language" name="language" value="${bo?.language}"/>
        </td>
      </tr>
      <tr>
        <td width="20%" class="left_title_1">我的网络店铺</td>
        <td width="30%" class="fillin">
          <input type="text" id="webShop" name="webShop" value="${bo?.webShop}"/>
        </td>
        <td width="20%" class="left_title_1">店铺名称</td>
        <td width="30%" class="fillin">
          <input type="text" id="webShopName" name="webShopName" value="${bo?.webShopName}"/>
        </td>
      </tr>
      <tr>
        <td width="20%" class="left_title_1">自我介绍</td>
        <td width="30%" class="fillin" colspan="3">
          <textarea style="width:100%;height:100%;" rows="4" id="selfIntroduction" name="selfIntroduction">${bo?.selfIntroduction}</textarea>
        </td>

      </tr>
      <tr>
        <td align="center" colspan="4">
          <a id="doSave" href="javaScript:saveForm('submitForm')"><img src="${resource(dir: '/images/admin_ui/', file: 'save1.gif', absolute: true)}" alt="保存"/></a>
        </td>
      </tr>
    </table>
  </form>
  <form id="companyForm" name="companyForm" action="${createLink(controller: "user", action: 'saveCompany', absolute: true)}" method="post">
    <input type="hidden" name="property" value="Company"/>
    <input type="hidden" name="id" value="${user?.company?.id}"/>
    <input type="hidden" name="createUser.id" value="${user?.id}"/>
    <table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" class="table_style">
      <tr>
        <td align="center" colspan="4" class="center_title_1">
          <b>公司信息</b>
        </td>
      </tr>
      <tr>
        <td width="20%" class="left_title_1">公司名称</td>
        <td width="30%" class="fillin">
          <input type="text" name="name" value="${user?.company?.name}"/>
        </td>
        <td width="20%" class="left_title_1">所在楼盘</td>
        <td width="30%" class="fillin">
          <input type="text" id="user.company.estate.name" name="user.company.estate.name" value="${user?.company?.estate?.name}" class="input_dict {notEmpty:'板块/商圈'}" tips="请选择楼盘"/>
          <input type="hidden" id="user.company.estate.id" name="estate.id" value="${user?.company?.estate?.id}"/>
        </td>
      </tr>
      <tr>
        <td width="20%" class="left_title_1">公司电话</td>
        <td width="30%" class="fillin">
          <input type="text" name="telephone" value="${user?.company?.telephone}"/>
        </td>
        <td width="20%" class="left_title_1">公司网址</td>
        <td width="30%" class="fillin">
          <input type="text" name="homePage" value="${user?.company?.homePage}"/>
        </td>
      </tr>
      <tr>
        <td width="20%" class="left_title_1">公司地址</td>
        <td width="30%" class="fillin" colspan="3">
          <input type="text" name="address" value="${user?.company?.address}"/>
        </td>
      </tr>
      <tr>
        <td width="20%" class="left_title_1">公司简介</td>
        <td width="30%" class="fillin" colspan="3">
          <textarea style="width:100%;height:100%;" rows="4" id="introduction" name="introduction">${user?.company?.introduction}</textarea>
        </td>
      </tr>
      <tr>
        <td align="center" colspan="4">
          <a href="javaScript:saveForm('companyForm')"><img src="${resource(dir: '/images/admin_ui/', file: 'save1.gif', absolute: true)}" alt="保存"/></a>
        </td>
      </tr>
    </table>
  </form>
</div>
</body>
</html>
